home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Linux Cubed Series 7: Sunsite
/
Linux Cubed Series 7 - Sunsite Vol 1.iso
/
system
/
network
/
samba
/
patches
/
samba-1.015
/
samba-1
Wrap
Text File
|
1995-07-03
|
18KB
|
604 lines
diff -u -r --new-file last-version/docs/DIAGNOSIS.txt samba-1.9.14alpha5/docs/DIAGNOSIS.txt
--- last-version/docs/DIAGNOSIS.txt Fri Jun 30 13:59:13 1995
+++ samba-1.9.14alpha5/docs/DIAGNOSIS.txt Sun Jul 2 20:32:08 1995
@@ -118,20 +118,28 @@
run the command "nmbd -L ACLIENT"
This time we are trying the same as the previous test but are trying
-it via a broadcast to the default broadcast address. If this doesn't
-give the same result as the previous test then nmbd isn't correctly
-getting your broadcast address. You should experiment with the -B
-option, trying different broadcast addresses until your find the one
-that works. It will most likely be something like a.b.c.255 as
-microsoft tcpip stacks only listen on 1's based broadcast addresses.
+it via a broadcast to the default broadcast address.
-Once you have it right you should add the -B option the the command
-line of nmbd in inetd.conf or in the script you use to start nmbd as
-a daemon. Once you do this go back to the "nmbd -L __SAMBA__ -B
-BIGSERVER" test to make sure you have it running properly.
+If this doesn't give the same result as the previous test then nmbd
+isn't correctly getting your broadcast address through its automatic
+mechanism. In this case you should experiment with the -B option which
+allows you to manually specify the broadcast address, overriding the
+automatic detection. You should try different broadcast addresses
+until your find the one that works. It will most likely be something
+like a.b.c.255 as microsoft tcpip stacks only listen on 1's based
+broadcast addresses. If you get stuck then ask your local networking
+guru for help (and show them this paragraph).
+If you find you do need the -B option (ie. the automatic detection
+doesn't work) then you should add the -B option with the right
+broadcast address for your network to the command line of nmbd in
+inetd.conf or in the script you use to start nmbd as a daemon. Once
+you do this go back to the "nmbd -L __SAMBA__ -B BIGSERVER" test to
+make sure you have it running properly.
+
If your PC and server aren't on the same subnet then you will need to
-use -B to set the broadcast address to the that of the PCs subnet.
+use the -B option to set the broadcast address to the that of the PCs
+subnet.
TEST 7:
-------
diff -u -r --new-file last-version/examples/dce-dfs/README samba-1.9.14alpha5/examples/dce-dfs/README
--- last-version/examples/dce-dfs/README Thu Jan 1 10:00:00 1970
+++ samba-1.9.14alpha5/examples/dce-dfs/README Mon Jul 3 11:26:35 1995
@@ -0,0 +1,4 @@
+this is a sample configuration file from Jim Doyle <doyle@oec.com> who
+did the DCE/DFS patches for Samba. It shows how to make DCE/DFS shares
+available.
+
diff -u -r --new-file last-version/examples/dce-dfs/smb.conf samba-1.9.14alpha5/examples/dce-dfs/smb.conf
--- last-version/examples/dce-dfs/smb.conf Thu Jan 1 10:00:00 1970
+++ samba-1.9.14alpha5/examples/dce-dfs/smb.conf Mon Jul 3 11:24:29 1995
@@ -0,0 +1,42 @@
+[global]
+ printing = bsd
+ printcap name = /etc/printcap
+ load printers = no
+ guest account = guest
+ log file = /usr/local/samba/var/log.%m
+ log level = 8
+ password level = 8
+
+[homes]
+ comment = Home Directories
+ browseable = no
+ read only = no
+ create mode = 0750
+
+[test]
+ comment = test stuff
+ path = /dept/mis/home/testacct
+ valid users = testacct
+ public = no
+ writable = yes
+
+[namespace]
+ comment = DCE-DFS Global Root
+ path = /...
+ public = no
+ writable = yes
+
+[oecdfs]
+ comment = Corporate Cell
+ path = /.../corp.boston.oec.com/fs
+ browseable = no
+ read only = no
+ create mode = 0750
+
+[develdfs]
+ comment = Technology Development Cell
+ path = /.../devel.boston.oec.com/fs
+ browseable = no
+ read only = no
+ create mode = 0750
+
diff -u -r --new-file last-version/source/Makefile samba-1.9.14alpha5/source/Makefile
--- last-version/source/Makefile Fri Jun 30 17:13:05 1995
+++ samba-1.9.14alpha5/source/Makefile Mon Jul 3 10:00:20 1995
@@ -125,14 +125,14 @@
######################################
-# This is for SUNOS 4. Use the SOLARIS entry for SunOS 5.
+# This is for SUNOS 4. Use the SUNOS5 entry for Solaris 2.
# Note that you cannot use Suns "cc" compiler
# as it's not an Ansi-C compiler. Get gcc or acc.
# Note that if you have adjunct passwords you may need the GETPWANAM
# or PWDAUTH option. There have been reports that using PWDAUTH may crash
# your pwdauthd server so GETPWANAM is preferable (and probably faster)
# contributed by Andrew.Tridgell@anu.edu.au
-# FLAGSM = -DSUN
+# FLAGSM = -DSUNOS4
# LIBSM =
@@ -149,9 +149,9 @@
# LIBSM =
-# This is for SOLARIS 2.2 and above (aka SunOS 5)
+# This is for SUNOS5 (also known as Solaris 2)
# contributed by Andrew.Tridgell@anu.edu.au
-# FLAGSM = -DSOLARIS -DSHADOW_PWD -DNETGROUP -DBSD_COMP
+# FLAGSM = -DSUNOS5 -DSHADOW_PWD -DNETGROUP -DBSD_COMP
# LIBSM = -lsocket -lnsl
@@ -392,7 +392,8 @@
CFLAGS = $(CFLAGS1) $(CFLAGS2) $(CFLAGS3) $(CFLAGS4) $(FLAGSM) $(AFS_FLAGS) $(DCE_FLAGS)
LIBS = $(LIBS1) $(LIBSM) $(DCE_LIBS)
-PROGS = smbd smbclient nmbd testparm testprns smbrun smbstatus smbtar
+PROGS = smbd smbclient nmbd testparm testprns smbrun smbstatus
+SCRIPTS = smbtar
all : CHECK $(PROGS)
@@ -446,11 +447,11 @@
install: installbin installman
installbin: all
- @$(SHELL) installbin.sh $(INSTALLPERMS) $(BINDIR) $(LIBDIR) $(VARDIR) $(PROGS)
+ @$(SHELL) installbin.sh $(INSTALLPERMS) $(BINDIR) $(LIBDIR) $(VARDIR) $(PROGS) $(SCRIPTS)
# revert to the previously installed version
revert:
- @$(SHELL) revert.sh $(BINDIR) $(PROGS)
+ @$(SHELL) revert.sh $(BINDIR) $(PROGS) $(SCRIPTS)
installman:
@$(SHELL) installman.sh $(MANDIR)
diff -u -r --new-file last-version/source/change-log samba-1.9.14alpha5/source/change-log
--- last-version/source/change-log Sat Jul 1 15:05:38 1995
+++ samba-1.9.14alpha5/source/change-log Mon Jul 3 14:30:12 1995
@@ -1474,14 +1474,15 @@
- extensive changes to ipc.c and miscellaneous other changes
from ad@papyrus.hamburg.com (Andreas Degert). Should especially
help OS/2 users
-
+ - added name release to nmbd
+ - relesed alpha4
+ - fixed "SOLARIS" to SUNOS5 in Makefile
+ - several minor fixups to get it to compile on aix, osf1, ultrix,
+ solaris and sunos
==========
todo:
-make samba react to name registrations, and master browser
-requests/announcements.
-
proper include file handling - need to keep a date for each include file
(linked list?) and check for changes against those dates. A pain.
@@ -1489,15 +1490,14 @@
implement SMBmove and SMBcopy ??
-change the check and mkdir targets to be portable - probably via scripts
-
add option to print more info about locked files (full path, share name
etc)
-patch for user and group names in status.c
-
sort by inode on opendir?
+rename only if not rdonly?
+
+no refresh/reg of new IP? or send wack and challenge owner?
new nmb.conf file
diff -u -r --new-file last-version/source/checkos.sh samba-1.9.14alpha5/source/checkos.sh
--- last-version/source/checkos.sh Thu Jun 29 18:21:39 1995
+++ samba-1.9.14alpha5/source/checkos.sh Mon Jul 3 14:06:57 1995
@@ -15,3 +15,4 @@
exit 1
fi
+exit 0
diff -u -r --new-file last-version/source/includes.h samba-1.9.14alpha5/source/includes.h
--- last-version/source/includes.h Fri Jun 30 17:14:21 1995
+++ samba-1.9.14alpha5/source/includes.h Mon Jul 3 11:49:41 1995
@@ -206,6 +206,7 @@
#include <errno.h>
#include <sys/wait.h>
#include <signal.h>
+#define NO_MEMMOVE
#ifdef sun386
#define NO_STRFTIME
#define NO_UTIMBUF
diff -u -r --new-file last-version/source/ipc.c samba-1.9.14alpha5/source/ipc.c
--- last-version/source/ipc.c Sat Jul 1 14:58:44 1995
+++ samba-1.9.14alpha5/source/ipc.c Mon Jul 3 14:08:50 1995
@@ -258,13 +258,27 @@
p->stringlen = n;
}
+#ifdef __STDC__
static int package(struct pack_desc* p, ...)
{
+#else
+static int package(va_alist)
+va_dcl
+{
+ struct pack_desc* p;
+#endif
va_list args;
int needed=0, stringneeded;
char* str=NULL;
int is_string=0, stringused;
+
+#ifdef __STDC__
va_start(args,p);
+#else
+ va_start(args);
+ p = va_arg(args,struct pack_desc *);
+#endif
+
if (!*p->curpos) {
if (!p->subcount)
p->curpos = p->format;
@@ -273,14 +287,15 @@
p->subcount--;
}
}
- #if CHECK_TYPES
+#if CHECK_TYPES
str = va_arg(args,char*);
if (strncmp(str,p->curpos,strlen(str)) != 0) {
DEBUG(2,("type error in package: %s instead of %*s in %s/%s\n",str,
strlen(str),p->curpos,p->format1,p->format2));
+ va_end(args);
return 0;
}
- #endif
+#endif
stringneeded = -1;
switch( *p->curpos++ ) {
case 'W': /* word (2 byte) */
diff -u -r --new-file last-version/source/local.h samba-1.9.14alpha5/source/local.h
--- last-version/source/local.h Thu Jun 29 09:30:23 1995
+++ samba-1.9.14alpha5/source/local.h Mon Jul 3 11:08:36 1995
@@ -104,6 +104,10 @@
#define REGISTRATION_INTERVAL (10*60)
#define NMBD_INETD_TIMEOUT (120)
#define NMBD_MAX_TTL (24*60*60)
+#define LPQ_LOCK_TIMEOUT (5)
+
+/* the following are in milliseconds */
+#define LOCK_RETRY_TIMEOUT (100)
/* do you want to dump core (carefully!) when an internal error is
encountered? Samba will be careful to make the core file only
diff -u -r --new-file last-version/source/locking.c samba-1.9.14alpha5/source/locking.c
--- last-version/source/locking.c Thu Jun 29 18:18:43 1995
+++ samba-1.9.14alpha5/source/locking.c Mon Jul 3 11:11:42 1995
@@ -123,7 +123,34 @@
#endif
}
+/*******************************************************************
+lock a file - returning a open file descriptor or -1 on failure
+The timeout is in seconds. 0 means no timeout
+********************************************************************/
+int file_lock(char *name,int timeout)
+{
+ int fd = open(name,O_RDWR|O_CREAT,0666);
+ time_t t=0;
+ if (fd < 0) return(-1);
+ if (timeout) t = time(NULL);
+ while (!timeout || (time(NULL)-t < timeout)) {
+ if (fcntl_lock(fd,F_SETLK,0,1,F_WRLCK)) return(fd);
+ msleep(LOCK_RETRY_TIMEOUT);
+ }
+
+ return(-1);
+}
+
+/*******************************************************************
+unlock a file locked by file_lock
+********************************************************************/
+void file_unlock(int fd)
+{
+ if (fd<0) return;
+ fcntl_lock(fd,F_SETLK,0,1,F_UNLCK);
+ close(fd);
+}
/****************************************************************************
diff -u -r --new-file last-version/source/nameserv.c samba-1.9.14alpha5/source/nameserv.c
--- last-version/source/nameserv.c Sun Jul 2 02:08:39 1995
+++ samba-1.9.14alpha5/source/nameserv.c Mon Jul 3 13:48:38 1995
@@ -863,8 +863,7 @@
}
}
- if (n>=0 && names[n].ttl>0) {
- names[n].ttl = ttl;
+ if (n>=0 && names[n].ttl>0 && !memcmp(&names[n].ip,&ip,sizeof(ip))) {
names[n].ip = ip;
names[n].ttl = ttl;
names[n].start_time = time(NULL);
diff -u -r --new-file last-version/source/password.c samba-1.9.14alpha5/source/password.c
--- last-version/source/password.c Fri Jun 30 23:45:39 1995
+++ samba-1.9.14alpha5/source/password.c Mon Jul 3 11:44:10 1995
@@ -1150,7 +1150,9 @@
DEBUG(3,("password server %s accepted the password\n",pserver));
+#ifndef KEEP_PASSWORD_SERVER_OPEN
close(password_client); password_client=-1;
+#endif
return(True);
}
diff -u -r --new-file last-version/source/printing.c samba-1.9.14alpha5/source/printing.c
--- last-version/source/printing.c Sat Jul 1 14:26:15 1995
+++ samba-1.9.14alpha5/source/printing.c Mon Jul 3 11:06:19 1995
@@ -379,7 +379,7 @@
for (count=0; count<8 && next_token(&line,tok[count],NULL); count++) ;
- /* we must get 8 tokens for time calculation, otherwise 3 will do*/
+ /* we must get 8 tokens for time calculation, otherwise 3 will do */
if (count < 3) return(False);
/* first token must be printer name (cannot check ??) */
@@ -517,8 +517,8 @@
FILE *f;
struct stat sbuf;
BOOL dorun=True;
- int fd = -1;
int cachetime = lp_lpqcachetime();
+ int lfd = -1;
*line = 0;
@@ -541,30 +541,24 @@
standard_sub(cnum,syscmd);
sprintf(outfile,"/tmp/lpq.%08x",str_checksum(syscmd));
-
- if (!lpq_cache_reset &&
- cachetime &&
- stat(outfile,&sbuf) == 0 &&
- (time(NULL) - sbuf.st_mtime)<cachetime) {
- DEBUG(3,("Using cached lpq output\n"));
- dorun = False;
- }
-
- if (dorun) {
- int fd = open(outfile,O_RDWR);
- if (fd >= 0) {
- flock(fd,LOCK_EX);
- if (!lpq_cache_reset &&
- cachetime && fstat(fd,&sbuf) == 0 &&
- (time(NULL) - sbuf.st_mtime)<cachetime) {
+
+ if (!lpq_cache_reset && cachetime && !stat(outfile,&sbuf))
+ {
+ if (time(NULL) - sbuf.st_mtime < cachetime) {
DEBUG(3,("Using cached lpq output\n"));
dorun = False;
- flock(fd,LOCK_UN);
- close(fd);
- fd = -1;
}
+
+ if (dorun) {
+ lfd = file_lock(outfile,LPQ_LOCK_TIMEOUT);
+ if (lfd<0 ||
+ (!fstat(lfd,&sbuf) && (time(NULL) - sbuf.st_mtime)<cachetime)) {
+ DEBUG(3,("Using cached lpq output\n"));
+ dorun = False;
+ file_unlock(lfd); lfd = -1;
+ }
+ }
}
- }
if (dorun) {
ret = smbrun(syscmd,outfile);
@@ -574,8 +568,10 @@
lpq_cache_reset = False;
f = fopen(outfile,"r");
- if (!f)
+ if (!f) {
+ if (lfd >= 0) file_unlock(lfd);
return(0);
+ }
if (status)
strcpy(status->message,"");
@@ -600,13 +596,12 @@
fclose(f);
- if (fd >= 0) {
- flock(fd,LOCK_UN);
- close(fd);
- fd = -1;
- }
+ if (lfd >= 0) file_unlock(lfd);
- if (!cachetime) unlink(outfile);
+ if (!cachetime)
+ unlink(outfile);
+ else
+ chmod(outfile,0666);
return(count);
}
diff -u -r --new-file last-version/source/server.c samba-1.9.14alpha5/source/server.c
--- last-version/source/server.c Sat Jul 1 14:49:28 1995
+++ samba-1.9.14alpha5/source/server.c Mon Jul 3 09:45:03 1995
@@ -1627,8 +1627,6 @@
close(Client); /* The parent doesn't need this socket */
#endif
}
- close(s);
- return False;
}
else
{
diff -u -r --new-file last-version/source/smb.h samba-1.9.14alpha5/source/smb.h
--- last-version/source/smb.h Sat Jul 1 14:01:04 1995
+++ samba-1.9.14alpha5/source/smb.h Mon Jul 3 10:30:56 1995
@@ -548,6 +548,9 @@
};
/* and a few prototypes */
+void msleep(int t);
+int file_lock(char *name,int timeout);
+void file_unlock(int fd);
int find_service(char *service);
int TvalDiff(struct timeval *tvalold,struct timeval *tvalnew);
int smb_offset(char *p,char *buf);
diff -u -r --new-file last-version/source/smbtar samba-1.9.14alpha5/source/smbtar
--- last-version/source/smbtar Thu Jan 1 10:00:00 1970
+++ samba-1.9.14alpha5/source/smbtar Thu Jun 29 17:58:36 1995
@@ -0,0 +1,87 @@
+#!/bin/sh
+#
+
+# edit this to show where your smbclient is
+SMBCLIENT="./smbclient"
+
+server=""
+service=backup
+password=""
+username=$LOGNAME
+verbose="/dev/null"
+log="-d 2"
+newer=""
+blocksize=""
+tarcmd="tar c"
+TF=${TAPE-tar.out}
+
+USAGE=$0" [ -pxut ] -s server\n
+ -p password\n
+ -x service\n
+ -n newer\n
+ -i incremental\n
+ -b blocksize\n
+ -r restore\n
+ -l log\n
+ -u user\n
+ -r restore\n
+ -t tape"
+
+while getopts ril:b:n:vs:p:x:u:t: c; do
+ case $c in
+ r) tarcmd="tar x"
+ ;;
+ i) incremental="tarmode inc reset"
+ ;;
+ l) log="-d $OPTARG"
+ ;;
+ n) if [ -f $OPTARG ]; then
+ newer="newer $OPTARG"
+ else
+ echo $0: Warning, $OPTARG not found
+ fi
+ ;;
+ s) server=$OPTARG
+ ;;
+ b) blocksize="blocksize $OPTARG"
+ ;;
+ p) password=$OPTARG
+ ;;
+ x) service=$OPTARG
+ ;;
+ t) TF=$OPTARG
+ ;;
+ u) username=$OPTARG
+ ;;
+ v) verbose="/dev/tty"
+ ;;
+ \?) echo $USAGE
+ exit 2
+ ;;
+ esac
+done
+
+shift `expr $OPTIND - 1`
+
+if [ $service = "" ]; then
+ echo $USAGE
+ exit 1
+fi
+
+if [ -n $verbose ]; then
+ echo server is $server
+ echo service is $service
+ echo tar cmd is $tarcmd
+ echo password is $password
+ echo share is $service
+ echo tape is $TF
+fi
+
+(
+ echo "lowercase"
+ echo $newer
+ echo $blocksize
+ echo $incremental
+ echo $tarcmd $TF
+) | $SMBCLIENT "\\\\$server\\$service" $password -U $username -N $log > $verbose
+
diff -u -r --new-file last-version/source/util.c samba-1.9.14alpha5/source/util.c
--- last-version/source/util.c Sat Jul 1 14:56:52 1995
+++ samba-1.9.14alpha5/source/util.c Mon Jul 3 10:39:40 1995
@@ -2481,6 +2481,29 @@
return(ret);
}
+/*******************************************************************
+sleep for a specified number of milliseconds
+********************************************************************/
+void msleep(int t)
+{
+ int tdiff=0;
+ struct timeval tval,t1,t2;
+ fd_set fds;
+
+ GetTimeOfDay(&t1);
+ GetTimeOfDay(&t2);
+
+ while (tdiff < t) {
+ tval.tv_sec = (t-tdiff)/1000;
+ tval.tv_usec = 1000*((t-tdiff)%1000);
+
+ FD_ZERO(&fds);
+ select(255,NULL,SELECT_CAST &fds,NULL,&tval);
+
+ GetTimeOfDay(&t2);
+ tdiff = TvalDiff(&t1,&t2);
+ }
+}
/****************************************************************************
check if a string is part of a list
@@ -3395,7 +3418,7 @@
{
int one=1;
- setsockopt(res,SOL_SOCKET,SO_REUSEADDR,&one,sizeof(one));
+ setsockopt(res,SOL_SOCKET,SO_REUSEADDR,(char *)&one,sizeof(one));
}
return res;
diff -u -r --new-file last-version/source/version.h samba-1.9.14alpha5/source/version.h
--- last-version/source/version.h Sun Jul 2 02:17:52 1995
+++ samba-1.9.14alpha5/source/version.h Mon Jul 3 15:00:12 1995
@@ -1 +1 @@
-#define VERSION "1.9.14alpha4"
+#define VERSION "1.9.14alpha5"